<?php

namespace App\Common;

use App\Common\User\WxUser;
use App\Traits\TraitConnectDB;
use App\Traits\TraitCommon;

class Base
{
    use TraitConnectDB, TraitCommon;


    static public function funcIns($entity = null)
    {
        $app = new static();

        if ($entity != null)
        {
            $app->funcSet_entity($entity);
        }

        return $app;
    }


    protected $pub_entity;

    public function funcSet_entity($val)
    {
        $this->pub_entity = $val;
    }

    public function funcGet_entity()
    {
        return $this->pub_entity;
    }


    /**
     * 用户
     *
     * @return WxUser
     */
    public function funcAppUser()
    {
        $app = WxUser::funcIns();

        return $app;
    }
}